package com.winit.project.handler;

import com.winit.core.server.base.CmdOutputHandler;

/**
 * Created by wangjian on 16/9/12.
 */
public class BuildResultHandler extends CmdOutputHandler {

    private BuildHandler handler = null;

    private Boolean status = true;

    private String msg;

    public Boolean isSuccess() {
        return status;
    }

    public void setHandler(BuildHandler handler) {
        this.handler = handler;
    }

    public BuildHandler getHandler() {
        return handler;
    }

    @Override
    public void onMessage(String cmd, int index, String message, Boolean isErrorMessage) {
        this.status = !isErrorMessage;
        this.msg = message;
        if(this.handler == null){
            return;
        }
        this.handler.onMessage(message);
    }

    public String getMsg() {
        return msg;
    }
}
